import React from 'react'
import ReactDOM from 'react-dom'
import App from './components/App'
import { Provider } from 'react-redux'
import {createStore, applyMiddleware} from 'redux'
import thunkMiddleware from 'redux-thunk'
import reducer from './reducers'
import {initSettings} from './actions/settings'
import {initUser} from './actions/user'

const store = createStore(reducer, applyMiddleware(thunkMiddleware))
store.dispatch(initSettings())
store.dispatch(initUser())
  ReactDOM.render(
    <Provider store={store}>
        <App />
    </Provider>,
        document.getElementById('root')
    )

